/*
Kakine
ActionScript Framework
Copyright © 2011, PUNY, LLC.

This file is part of KAKINE.

KAKINE is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

KAKINE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with KAKINE.  If not, see <http://www.gnu.org/licenses/>.
*/ 
package com.puny.mvc.views.platformer.movieclips
{
	import flash.display.DisplayObject;
	import flash.geom.Point;
	
	public class PlatformView extends CharacterView {
		private var _active:Boolean = true;
		private var _hitPower:Point = new Point();
		public function PlatformView() {
			super();
		}
		
		public function set active(value:Boolean):void {
			_active = value;
		}
		
		public function isActive():Boolean {
			return _active;
		}
		
		public function hitPower(obj:DisplayObject):Point {
			_hitPower = (obj as CharacterView).center.subtract(center);
			_hitPower.x = (_hitPower.x > 0)? 3 : ((_hitPower.x < 0)? -3 : 0); 
			_hitPower.y = (_hitPower.y > 0)? 3 : ((_hitPower.y < 0)? -3 : -5); 
			return _hitPower;
		}
		
	}
}